<?php
$this->menu=array(
    array('label'=>Yii::t('site','Item'),'items'=>array(
        array('label'=>Yii::t('site','Update Milestone'), 'url'=>array('update', 'id'=>$_GET['milestoneId'])),
        array('label'=>Yii::t('site','View Milestone'), 'url'=>array('view','id'=>$_GET['milestoneId'])),
    )),
    array('label'=>Yii::t('site','All Items'),'items'=>array(
        array('label'=>Yii::t('site','Create New Milestone'), 'url'=>array('create')),
        array('label'=>Yii::t('site','Manage Milestones'), 'url'=>array('admin')),
    )),
);
?>

<?php if($type=='status/priorities') : ?>

<h1><?php echo CHtml::encode(Yii::t('site','Stati & Priorities')); ?></h1>
<?php $this->widget('application.components.crosstab',
    array(
        //'debug'=>true,
        'row'=>'i.issueStatus',
        'rowLabel'=>Yii::t('site','Status'),
        'column' => "ELT(i.priority, '".'1 - '.Yii::t('site','High')."', '".'2 - '.Yii::t('site','Medium')."', '".'3 - '.Yii::t('site','Low')."')",
        'columnLabel' => Yii::t('site','Priority'),
        'cells' => 'COUNT(i.id)',
        'cellsLabel' => Yii::t('site','Count Issues'),
        'cellsLink'=>array('/issue/admin','crosstab'=>'status/priorities','Issue[milestoneId]'=>$_GET['milestoneId']),
        'from'=>'Issue i',
        'where'=>"i.milestoneId=".$_GET['milestoneId'] // ." AND i.issueStatus IN('swIssue/new','swIssue/assigned','swIssue/started')",
    )
); ?>

<?php else : ?>
    <h1><?php echo CHtml::encode(Yii::t('site','Milestone Reports')); ?></h1>
<p><?php echo CHtml::encode(Yii::t('site','Unsupported report type: {reportType}',array('{reportType}'=>$type))); ?></p>
<?php endif; ?>
